﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RegisterPage.aspx.cs" Inherits="RegisterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>注册</title>
    <link rel="stylesheet" type="text/css" href="publicResource/main.css"/>
    <script type="text/javascript">
        function OnValidateAdminName() {
            var adminName = document.getElementById("AdminNameTextBox").value;
            RegisterWebService.IsAdminNameExist(adminName, OnValidateComplete, OnError);
        }
        function OnValidateComplete(result) {
            if (result) {
                alert("登录名已存在，请重新命名");
                document.getElementById("AdminNameTextBox").focus();
            }
        }
        function OnError(result) {
            alert("出错了!【" + result + "】");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server">
        <Services>
            <asp:ServiceReference Path="~/webServiceASMX/RegisterWebService.asmx" />
        </Services>
    </asp:ScriptManager>
        <table width="730" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td height="34" style="background-image:publicResource/bj2.gif"><strong>&nbsp;&nbsp;&nbsp;&nbsp;注册</strong></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="center">
                <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            <table width="577" border="1" align="center" cellpadding="5" style="background-color:#999999">
                                <tr>
                                    <td align="center">导入key：</td>
                                    <td>
                                        <asp:FileUpload ID="KeyFileUpload" runat="server" />
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ForeColor="Red" 
                                            ControlToValidate="KeyFileUpload" ErrorMessage="RequiredFieldValidator">key文件不能空</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">企业名：</td>
                                    <td><asp:TextBox ID="CompanyNameTextBox" runat="server" />
                                        <span>（*可选填）</span></td>
                                </tr>
                                <tr>
                                    <td align="center">登录名：</td>
                                    <td><asp:TextBox ID="AdminNameTextBox" runat="server" onblur="OnValidateAdminName();" />
                                        <asp:RequiredFieldValidator ID="NameRequiredFieldValidator" runat="server" 
                                            ErrorMessage="RequiredFieldValidator" ForeColor="Red" 
                                            ControlToValidate="AdminNameTextBox">登录名不能空</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                   <tr>
                                    <td align="center">密码：</td>
                                    <td><asp:TextBox ID="Pwd1TextBox" runat="server" TextMode="Password" />
                                        <asp:RequiredFieldValidator ID="P1RequiredFieldValidator" runat="server" 
                                            ErrorMessage="RequiredFieldValidator" ForeColor="Red" 
                                            ControlToValidate="Pwd1TextBox">密码不能为空</asp:RequiredFieldValidator>
                                       </td>
                                </tr>
                                <tr>
                                    <td align="center">确认密码：</td>
                                    <td><asp:TextBox ID="Pwd2TextBox" runat="server" TextMode="Password" />
                                        <asp:CompareValidator ID="PwdCompareValidator"
                                            runat="server" ErrorMessage="CompareValidator" 
                                            ControlToCompare="Pwd2TextBox" ControlToValidate="Pwd1TextBox" ForeColor="Red">密码不能匹配</asp:CompareValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">密码找回问题：</td>
                                    <td><asp:TextBox ID="QuestionTextBox" runat="server" />
                                        <span>（*可选填）</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">密码找回答案：</td>
                                    <td><asp:TextBox ID="AnswerTextBox" runat="server" />
                                        <span>（*可选填）</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">邮箱：</td>
                                    <td><asp:TextBox ID="EmailTextBox" runat="server" />
                                        <span>（*可选填）</span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>  
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="center">
                            <asp:ImageButton ID="RegImageButton" runat="server" 
                                ImageUrl="~/Account/publicResource/an2.gif" 
                                onclick="RegImageButton_Click" />
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Account/publicResource/an3.gif" />
                        </td>
                    </tr>
                </table>
            </td>
          </tr>
        </table>
    </form>
</body>
</html>
